package Chapter22.CollectionsMethod;

import java.util.*;

public class BinarySearch {

    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(59, 50, 7, 4, 10, 11, 66, 45, 60, 2);
        System.out.println(list);
        Collections.sort(list);
        System.out.println(list);
        System.out.println("(1) Index: " + Collections.binarySearch(list, 7));
        System.out.println("(1) Index: " + Collections.binarySearch(list, 9));
        System.out.println(list);
    }
}
